

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>

</title><link href='./home/css/etm.css' rel='stylesheet' type='text/css' /><!--[if IE 8]> <link href='/Themes/Theme3/ie8Fix.css' rel='stylesheet' /> <![endif]-->

    <script src="./home/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="./home/js/flexigrid.js"></script>
    <script src="./home/js/jQuery.Ex.js"></script>
    <script src="./home/js/WdatePicker.js"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=11; IE=10; IE=9; IE=8; IE=7; IE=EDGE"/><script src='./home/js/jquery.nicescroll.min.js' type='text/javascript'></script><script type='text/javascript'>var isEtmClient=false;function ReSizeScrollbar() { if ($('form').getNiceScroll().length > 0) {     $('form').getNiceScroll().onResize();}}function ReSizeFlexgridScrollbar() { if ($('.bDiv').getNiceScroll().length > 0) {     $('.bDiv').getNiceScroll().onResize();}}function InitFlexgridScrollbar(){     $('.bDiv').niceScroll({cursorcolor: '#75A801',zindex:4});}function ReSizenDivScrollbar() { if ($('.flexigrid .nDiv').getNiceScroll().length > 0) {     $('.flexigrid .nDiv').getNiceScroll().onResize();}}function InitnDivScrollbar(){     $('.flexigrid .nDiv').niceScroll({cursorcolor: '#75A801',horizrailenabled:false});}function proxyExecuteFun(funName) {if(funName == undefined || funName==null|| funName.length==0){window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return;}  if (window[funName]()) {window.parent.showsending(true, "执行中，请耐心等待");setTimeout(function() { window.parent.showsending(false); }, 5000);return true; } return false; };var _tmpOnSelectedFile = null;function onSelectedFile(fileName, fileUrl, isImg) {   if (_tmpOnSelectedFile != null) {        _tmpOnSelectedFile(fileName, fileUrl, isImg);    }}function showFileList(callback) {   window.parent.showDialog('查看素材库', '/Modules/OA/CMyFileListView.aspx?navId=5501130e-81b9-4f59-ba48-b0438e2c2a40', '900px', '450px');   _tmpOnSelectedFile = callback;}$(function () {if (navigator.userAgent.toLowerCase().indexOf('edge/') != -1) { $('input[type=submit],.tmpSubmitButton').bind({ mouseenter: function () { $(this).addClass('tmpSubmitButton'); $(this).prop('type', 'button'); }, mouseleave: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); }, click: function () { $(this).removeClass('tmpSubmitButton'); $(this).prop('type', 'submit'); } }); }if (window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { window.parent.showsending(false, ''); }$(".button").each(function() { if ($(this).attr("type") == "submit" &&!$(this).hasClass('noloading') && window.parent != undefined && window.parent != null && typeof window.parent.showsending != "undefined") { var tmpClick = $(this).attr("onclick");if(tmpClick == undefined || tmpClick==null|| tmpClick.length<2){ $(this).attr("onclick","proxyExecuteFun();");return;}  if (tmpClick.indexOf("return ") != -1 && tmpClick.indexOf("(") != -1) { tmpClick = tmpClick.substring(7).replace(/\s+/g, ''); if (tmpClick.indexOf("()") != -1) { var funName = tmpClick.substring(0, tmpClick.indexOf("(")); $(this).attr("onclick","return proxyExecuteFun('" + funName + "');"); } } } });$('body').click(function() {     if (typeof parent.onChildPageClick !='undefined') {         parent.onChildPageClick();     }});     $('form').height($(window).height()-0).niceScroll({cursorcolor: '#75A801',horizrailenabled:false });     $(window).resize(function () {         ReSizeScrollbar();     });});</script>
    <script type="text/javascript">
        function ShowApplyInfo(ApplyGuid) {
            window.parent.showDialog("申请信息查看", "../Modules/Asset/ApplyInfo.aspx?ApplyGuid=" + ApplyGuid, "900px", "620px");
        }

        function getStatusName(dostatus) {
            var strResult = "";
            switch (dostatus) {
                case "0": strResult = "未审核"; break;
                case "1": strResult = "已审核"; break;
                case "2": strResult = "移交配送"; break;
                case "3": strResult = "已出库"; break;
                case "4": strResult = "已入库"; break;
            }
            return strResult;
        }
    </script>
</head>
<body>
    <form method="post" action="ApplyList.aspx?navId=5501130e-81b9-4f59-ba48-b0438e2c2a40" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEzMzQyOTkzMTJkZD7uO7wjZ8TSxDZw5uDp4ojjXqcZoBTwpiEGANB3keur" />
</div>

<div class="aspNetHidden">

	<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="4B6CF2B7" />
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAwMD4x9OH7h+wPxAi07cL1GjJh5cHeDFoUAtNCGyq+F3qzV2XsK0ZyCVkAGYxrFR1ZXXdMMRLJFoInE53RfJSEVdpmTK/v4csDSXILdnB4PQ1ZdStlmwO9+Wiwox6qZMXcTD3zbKtzK+7JkmMpR2U9u7zje472OjrQkpxDYK2JYuZNcQtnKtb31hEtbT6bWJ99DjLh7EJ7OLsEu8dX8OeazUmmIZ/1MMUUcWANSRMxF5FzHfa6rCVN4H5E3Od2BTlQhIwslAeI4XpCF2/SCnqWFx8sWoNjGHFztl9m8XTBQMw==" />
</div>
        <table class="search">
            <tr>
                <td class="textAlignRight" style="width:78px;">
                    申请单号：
                </td>
                <td class="borderRight" style="width:160px;">
                    <input name="txtNo" type="text" id="txtNo" class="int" />
                </td>
                <td  class="textAlignRight" style="width:78px;">
                    申请时间：
                </td>
                <td class="borderRight" style="width: 172px;">
                    <input type="text" class="int" id="tbStartDate" name="tbStartDate" style="width: 70px;" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    - 
                    <input type="text" class="int" id="tbEndDate" name="tbEndDate" style="width: 70px;" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                </td>
                   <td class="textAlignRight" style="width:54px;">状态：
                </td>
                <td class="borderRight" style="width:118px;">

                    <select name="ddlStatus" id="ddlStatus" class="int" style="width:100px;">
	<option selected="selected" value="-1">请选择</option>
	<option value="0">未审核</option>
	<option value="1">正常</option>
	<option value="2">移交配送</option>
	<option value="3">已出库</option>
	<option value="4">已入库</option>

</select>

                </td>
                <td style="padding-left:20px;">
                    <input type="button" class="button" id="btnSearch" value="搜 索" />&nbsp;&nbsp;
            
                </td>
            </tr> 
        </table>
        <table id='Test' style='display:none;'></table><input type='text' style='display:none;' id='etmparams' name='etmparams' value='[{"IsCanHide":true,"FormatString":null,"ColumnType":"String","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"","Name":"ApplyGuid","Width":35,"Sortable":false,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":true,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":"DoStatus","IsJsAddColumn":false},{"IsCanHide":true,"FormatString":null,"ColumnType":"String","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"申请单号","Name":"ApplyNo","Width":120,"Sortable":false,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":true,"LinkStrForamtBindColumn":"ApplyGuid","LinkStrForamt":"javascript:ShowApplyInfo(\"{0}\")","LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false},{"IsCanHide":true,"FormatString":"yyyy-MM-dd HH:mm","ColumnType":"DateTime","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"申请时间","Name":"ApplyDate","Width":130,"Sortable":true,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false},{"IsCanHide":true,"FormatString":null,"ColumnType":"String","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"申请人","Name":"ApplyUserName","Width":120,"Sortable":false,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false},{"IsCanHide":true,"FormatString":"yyyy-MM-dd HH:mm","ColumnType":"DateTime","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"通过时间","Name":"CheckDate","Width":130,"Sortable":true,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false},{"IsCanHide":true,"FormatString":null,"ColumnType":"String","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"审核人","Name":"CheckUserName","Width":120,"Sortable":false,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false},{"IsCanHide":true,"FormatString":null,"ColumnType":"String","PageColumnGuid":"00000000-0000-0000-0000-000000000000","PageName":null,"SortId":0,"IsSetValueEqualName":false,"VirtualColumn":null,"Display":"状态","Name":"DoStatus","Width":80,"Sortable":true,"ColumnHeader_BindId":null,"ColumnHeader_IsBindDropDownList":false,"Align":"Center","Checkbox":false,"IsLink":false,"LinkStrForamtBindColumn":null,"LinkStrForamt":null,"LinkClass":"","OperationButtons":"","SubStringLength":0,"BindAttrs":null,"IsJsAddColumn":false}]'/><input type='text' style='display:none;' id='etmUrlparams' name='etmUrlparams' value='[{"Key":"navId","Value":"5501130e-81b9-4f59-ba48-b0438e2c2a40"}]'/><input type='text' style='display:none;' id='etmPageUrl' name='etmPageUrl' value='http://vip.yj.etmcn.com/Modules/Asset/ApplyList.aspx?navId=5501130e-81b9-4f59-ba48-b0438e2c2a40'/><input type='text' style='display:none;' id='pagename' name='pagename' value='Asset_ApplyList'/><input type='text' style='display:none;' id='pageamethod' name='pageamethod' value='Asset_ApplyListAsset_ApplyList'/><script type='text/javascript'> var etmFormId='form1';function fixIE9() {if ($.browser.msie && $.browser.version == 9) {$('#form1 select').each(function () {var name = $(this).attr('name');if (name != undefined && name.length > 0) {var value = $(this).val();if (value == null) {value = $(this).find('option:first').attr('value');$(this).val(value);}}});}}function RefreshGrid(){ $('#Test').flexOptions().flexReload(); };function addFormData() {fixIE9(); var dt = $('#form1').serializeArray(); $('#Test').flexOptions({ params: dt }); return true; }$(function () { $('#btnSearch').click(function () { $('#Test').flexOptions({ newp: 1 }).flexReload(); return false; }); });$('#Test').flexigrid({url: './data/zcWpsq.json',sortname: 'ApplyNo',sortorder: 'desc',usepager: true,useRp: true,rpOptions: [20,30,50,100,200],rp: 30,colModel: [{ display: '', name: 'ApplyGuid',etmname:'ApplyGuid', width: 35, sortable: false, align: 'Center', checkbox: true ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'',ColumnType:'String',IsJsAddColumn:false},{ display: '申请单号', name: 'ApplyNo',etmname:'ApplyNo', width: 120, sortable: false, align: 'Center', checkbox: false ,IsLink:true,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'',ColumnType:'String',IsJsAddColumn:false},{ display: '申请时间', name: 'ApplyDate',etmname:'ApplyDate', width: 130, sortable: true, align: 'Center', checkbox: false ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'yyyy-MM-dd HH:mm',ColumnType:'DateTime',IsJsAddColumn:false},{ display: '申请人', name: 'ApplyUserName',etmname:'ApplyUserName', width: 120, sortable: false, align: 'Center', checkbox: false ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'',ColumnType:'String',IsJsAddColumn:false},{ display: '通过时间', name: 'CheckDate',etmname:'CheckDate', width: 130, sortable: true, align: 'Center', checkbox: false ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'yyyy-MM-dd HH:mm',ColumnType:'DateTime',IsJsAddColumn:false},{ display: '审核人', name: 'CheckUserName',etmname:'CheckUserName', width: 120, sortable: false, align: 'Center', checkbox: false ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'',ColumnType:'String',IsJsAddColumn:false},{ display: '状态', name: 'DoStatus',etmname:'DoStatus', width: 80, sortable: true, align: 'Center', checkbox: false ,IsLink:false,LinkClass:'',OperationButtons:'',SubStringLength:0,hide:false,BindId:'',IsForDDL:false,IsCanHide:true,FormatString:'',ColumnType:'String',IsJsAddColumn:false}],width: $(window).width(),height: $(window).height()-220+60,onSubmit: addFormData});</script>
        <div style="margin-left: 20px;"><input type="submit" name="btnAdd" value="添加" onclick="return false;" id="btnAdd" class="button" />
            &nbsp;&nbsp;
            <input type="submit" name="btnStart1" value="修改" onclick="return false;" id="btnStart1" class="button" />
            &nbsp;&nbsp;
            <input type="submit" name="btnStart2" value="批量删除" onclick="return false;" id="btnStart2" class="button" />
                  &nbsp;&nbsp;
            <input type="submit" name="btnIn" value="入库" onclick="return false;" id="btnIn" class="button" /></div>
        <script type="text/javascript">
            $(function () {
                $("#btnAdd").live("click", function () {
                    var navId = '5501130e-81b9-4f59-ba48-b0438e2c2a40';
                    window.location.href = "ApplyEdit.aspx?navId=" + navId;
                });
                $("#btnStart1").live("click", function () {
                    var jsonObjList = [];
                    var isCheck = false;
                    var dostatus = "";
                    $("input[name='selectItem']:checkbox:checked").each(function () {
                        isCheck = true;
                        jsonObjList.push($(this).val());
                        dostatus = $(this).parent().parent().attr("dostatus");

                    })
                    if (isCheck == false) {
                        alert("未选择申请单！");
                    }
                    else {
                        show1(JSON.stringify(jsonObjList), dostatus);
                    }
                });
                $("#btnStart2").live("click", function () {
                    var jsonObjList = [];
                    var isCheck = false;
                    $("input[name='selectItem']:checkbox:checked").each(function () {
                        isCheck = true;
                        jsonObjList.push($(this).val());
                    })
                    if (isCheck == false) {
                        alert("未选择申请单！");
                    }
                    else {
                        show2(JSON.stringify(jsonObjList));
                    }
                });
                $("#btnIn").live("click", function () {
                    var jsonObjList = [];
                    var isCheck = false;
                    var dostatus = "";
                    $("input[name='selectItem']:checkbox:checked").each(function () {
                        isCheck = true;
                        jsonObjList.push($(this).val());
                        dostatus = $(this).parent().parent().attr("dostatus");

                    })
                    if (isCheck == false) {
                        alert("未选择申请单！");
                    }
                    else {
                        show3(JSON.stringify(jsonObjList), dostatus);
                    }
                });
            });
            function getUrlParam(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg);  //匹配目标参数
                if (r != null) return unescape(r[2]); return null; //返回参数值
            }
            function show1(jsonObjList, dostatus) {
                var navId = getUrlParam("navId");
                var JsonObjLists = jsonObjList.replace(/^[\[]/, "").replace(/[\]]$/, "");
                var test = JsonObjLists.split(",");
                if (test[1] != undefined) {
                    alert("请选择一条数据");
                }
                else if (dostatus != "0") {
                    alert("单据状态为 " + getStatusName(dostatus) + "，无法修改！");
                    return false;
                }
                else {
                    document.location.href = "../Asset/ApplyEdit.aspx?sc=btn&navId=5501130e-81b9-4f59-ba48-b0438e2c2a40&ApplyGuid=" + test[0].replace(/^\"|\"$/g, '') + "&multiLayer=1"
            }

    }
    function show2(jsonObjList) {
        var navId = getUrlParam("navId");
        var JsonObjLists = jsonObjList.replace(/^[\[]/, "").replace(/[\]]$/, "");
        var test = JsonObjLists.split(",");
        var count = 0;
        var counts = 0;
        for (var i in test) {
            counts++;
        }
        if (confirm("确定要删除吗？")) {
            for (var i in test) {
                count++;
                if (counts == 1) {
                    $.AjaxETM("K_Asset_ApplyDelete", { "ApplyGuid": test[i].replace(/^\"|\"$/g, ''), "count": count, "counts": counts },
                        function (data) {
                            alert(data);
                        },
                         true, "text");
                }
                else {
                    $.AjaxETM("K_Asset_ApplyDelete", { "ApplyGuid": test[i].replace(/^\"|\"$/g, ''), "count": count, "counts": counts },
                        function (data) {
                            if (data != "true") {
                                alert(data);
                            }
                        },
                         true, "text");
                }
            }
        }
    }
    function show3(jsonObjList, dostatus) {
        var navId = getUrlParam("navId");
        var JsonObjLists = jsonObjList.replace(/^[\[]/, "").replace(/[\]]$/, "");
        var test = JsonObjLists.split(",");
        if (test[1] != undefined) {
            alert("请选择一条数据");
        }
        else if (dostatus != "3") {
            alert("单据状态为 " + getStatusName(dostatus) + "，无法入库！");
            return false;
        }
        else {
            document.location.href = "../Asset/ApplyProductInInvertory.aspx?sc=btn&navId=5501130e-81b9-4f59-ba48-b0438e2c2a40&ApplyGuid=" + test[0].replace(/^\"|\"$/g, '') + "&multiLayer=1"
            }

    }
        </script>
    </form>
</body>
</html>